import request from '@/utils/request'

// 获取部门列表
export function dept() {
    return request({
        url: '/api/dept',
        method: 'get'
    })
}

// 获取当前部门下的部门列表
export function deptCurrent() {
    return request({
        url: '/api/dept/current',
        method: 'get'
    })
}

// 考试基本信息搜索
export function eExamInfo(params) {
    return request({
        url: '/api/eExamInfo',
        data: params,
        method: 'post'
    })
}

// 编辑考试基本信息
export function eExamInfoEdit(params) {
    return request({
        url: '/api/eExamInfo',
        data: params,
        method: 'put'
    })
}

// 获取考试基本信息
export function eExamInfoDetail(params) {
    return request({
        url: '/api/eExamInfo/detail/' + params,
        // params,
        method: 'get'
    })
}

// 获取考试配置信息
export function eExamConfigGet(params) {
    return request({
        url: '/api/eExamConfig/' + params,
        method: 'get'
    })
}

// 查询所有安全分类
export function frontAll() {
    return request({
        url: '/api/eSafeType/front-all',
        method: 'get'
    })
}

// 考试费用相关
export function examFee() {
    return request({
        url: '/api/eExamInfo/fee',
        method: 'get'
    })
}

// 添加考试配置信息
export function eExamConfig(params) {
    return request({
        url: '/api/eExamConfig',
        data: params,
        method: 'post'
    })
}

// 删除考试信息
export function deteleExamInfo(params) {
    return request({
        url: '/api/eExamInfo',
        params,
        method: 'delete'
    })
}

// 导出某场考试的成绩
export function scoreDownload(params) {
    return request({
        url: '/api/eExamInfo/download',
        params,
        method: 'get',
        responseType: 'blob'
    })
}

export function scoreDownload1(params) {
    return request({
        url: '/api/eExamInfo/download',
        params,
        method: 'get'
    })
}

// 发布考试
export function examIssue(params) {
    return request({
        url: '/api/eExamInfo/status',
        data: params,
        method: 'put'
    })
}

// 新增大题
export function eBigQues(params) {
    return request({
        url: '/api/eBigQues',
        data: params,
        method: 'post'
    })
}

// 删除大题
export function deleteBigQues(params) {
    return request({
        url: '/api/eBigQues/' + params,
        method: 'delete'
    })
}

// 删除配置信息
export function deteleConfig(params) {
    return request({
        url: '/api/eExamConfig/' + params,
        method: 'delete'
    })
}

// 修改配置信息
export function updateConfig(params) {
    return request({
        url: '/api/eExamConfig',
        data: params,
        method: 'put'
    })
}


export default {
    dept,
    eExamInfo,
    eExamInfoDetail,
    frontAll,
    examFee,
    eExamConfig,
    deteleExamInfo,
    scoreDownload,
    scoreDownload1,
    examIssue,
    eExamInfoEdit,
    eExamConfigGet,
    eBigQues,
    deleteBigQues,
    deteleConfig,
    updateConfig,
    deptCurrent
}